package class41To50;

import java.io.*;

public class RepeatMinimumLength {

    public static int MAX_N = 1000005;

    public static int[] next = new int[MAX_N];

    public static int n;

    public static char[] s;

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        n = Integer.valueOf(in.readLine());
        s = in.readLine().toCharArray();
        getNext(s, n);
        out.println(n - next[n]);
        out.flush();
        out.close();
        in.close();
    }

    private static void getNext(char[] s, int n) {
        if (n == 1) return;
        next[0] = -1;
        next[1] = 0;
        int i = 2;
        int cn = 0;
        while (i <= n) {
            if (s[i - 1] == s[cn]) {
                next[i++] = ++cn;
            } else if (cn > 0) {
                cn = next[cn];
            } else {
                next[i++] = 0;
            }
        }
    }
}
